load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "ranger",
    srcs = [
        "checker.go",
        "detacher.go",
        "points.go",
        "ranger.go",
        "types.go",
    ],
    importpath = "github.com/pingcap/tidb/util/ranger",
    visibility = ["//visibility:public"],
    deps = [
        "//errno",
        "//expression",
        "//kv",
        "//parser/ast",
        "//parser/charset",
        "//parser/format",
        "//parser/model",
        "//parser/mysql",
        "//parser/terror",
        "//planner/util/fixcontrol",
        "//sessionctx",
        "//sessionctx/stmtctx",
        "//types",
        "//types/parser_driver",
        "//util/chunk",
        "//util/codec",
        "//util/collate",
        "//util/dbterror",
        "//util/mathutil",
        "@com_github_pingcap_errors//:errors",
    ],
)

go_test(
    name = "ranger_test",
    timeout = "short",
    srcs = [
        "bench_test.go",
        "main_test.go",
        "ranger_test.go",
        "types_test.go",
    ],
    data = glob(["testdata/**"]),
    flaky = True,
    shard_count = 26,
    deps = [
        ":ranger",
        "//config",
        "//domain",
        "//expression",
        "//parser/ast",
        "//parser/model",
        "//parser/mysql",
        "//planner/core",
        "//session",
        "//sessionctx",
        "//sessionctx/variable",
        "//testkit",
        "//testkit/testdata",
        "//testkit/testsetup",
        "//types",
        "//util/collate",
        "@com_github_stretchr_testify//require",
        "@org_uber_go_goleak//:goleak",
    ],
)
